/**
 * 提交的时候检查
 * 
 * @returns {Boolean}
 */
function checkForm() {

	var email = getElementById("email");
	var passwd = getElementById("password");

	// 邮箱格式正确
	if (checkEmail(email.value, "login_font")) {
		// 将密码加密()
		if (passwd.value.length <= 18 && passwd.value.length >= 6) {
			var temp = passwd.value;
			passwd.value = hex_md5(temp);
			
			//alert(passwd.value);
			/*
			var value = email.value + "-" + passwd.value;
			// 是否要保存cookie
			var saveInfo = document.getElementsByName("saveInfo");
			var checkedValue = "yes";
			for ( var i = 0; i < saveInfo.length; i++) {
				if (saveInfo[i].checked) {
					checkedValue = saveInfo[i].value;
					break;
				}
			}
			// 保存cookie
			if (checkedValue == "yes") {
				SetCookie("saveInfo", value);
			} else {
				delCookie("saveInfo");
			}
			*/
		}
		return true;
	}
	return false;
}

/**
 * 是否有保存cookie
 */
function initSaveInfo() {
	var email = getElementById("email");
	var passwd = getElementById("password");
	
	var value = getCookie("saveInfo");
	if (value != null) {
		email.value = value.split("-")[0];
		passwd.value = value.split("-")[1];
		
		alert("init "+passwd.value);
		
		// 选定保存按钮
		var saveInfo = document.getElementsByName("saveInfo");
		for ( var i = 0; i < saveInfo.length; i++) {
			if (saveInfo[i].value == "yes") {
				saveInfo[i].checked = true;
				break;
			}
		}
	}
}
